home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Frameworks / SCAPI 0.85 / Spunk Cross API 1.0 / MacSCAPI / Headers / SCAPIWindow.h < prev   
Encoding:
Text File  |  1997-05-31  |  2.9 KB  |  121 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    SCAPIWindow.h               ©1997 Spunk Cross         All rights reserved.
  3. // ===========================================================================
  4.  
  5. #ifndef SCAPIWINDOW_H
  6. #define SCAPIWINDOW_H
  7.  
  8. #include "SCAPICommonIncludes.h"
  9. #include "SCAPIApp.h"
  10. #include "SCAPIMenuBar.h"
  11.  
  12.  
  13. // ---------------------------------------------------------------------------
  14. //        • Defines
  15. // ---------------------------------------------------------------------------
  16.  
  17. #define SCAPIWindow_default_title         "Spunk Cross"
  18. #define SCAPIWindow_default_originx        5
  19. #define SCAPIWindow_default_originy        42
  20. #define SCAPIWindow_default_width        300
  21. #define SCAPIWindow_default_height        200
  22.  
  23. #define SCAPIWindow_borders_width        3
  24. #define SCAPIWindow_borders_height        21
  25.  
  26. #define SCAPI_no_mark                    0
  27. #define SCAPI_dot_mark                    1
  28. #define SCAPI_check_mark                2
  29.  
  30.  
  31. // ---------------------------------------------------------------------------
  32. //        • SCAPIWindow Class
  33. // ---------------------------------------------------------------------------
  34.  
  35. class SCAPIWindow : public LWindow,
  36.                     public LListener
  37. {
  38.     friend class SCAPIApp;
  39.  
  40.     // ===========================================================
  41.     // === Spunk Cross API, these are the routines you can use ===
  42.     // ===========================================================
  43.     
  44.         // • Constructor - Destructor
  45.         // --------------------------
  46.         
  47.     public:
  48.     
  49.         SCAPIWindow(    SCAPIApp*    inAppP,
  50.                         char*        inTitle = SCAPIWindow_default_title,
  51.                         int            inOriginx = SCAPIWindow_default_originx,
  52.                         int         inOriginy = SCAPIWindow_default_originy,
  53.                         int            inWidth = SCAPIWindow_default_width,
  54.                         int            inHeight = SCAPIWindow_default_height        );
  55.                         
  56.         virtual ~SCAPIWindow();
  57.         
  58.         
  59.         // • Member functions
  60.         // ------------------
  61.         
  62.     public:
  63.         
  64.         void                AssociateMenuBar(SCAPIMenuBar*    inMenuBarP);
  65.         
  66.         
  67.     protected:
  68.     
  69.         virtual void        ExecuteCommand(int    inCommand);
  70.         
  71.         virtual void        CommandStatus(    int        inCommand,
  72.                                             bool    &outEnabled,
  73.                                             int        &outMark,
  74.                                             char*    outName            );
  75.         
  76.         
  77.     // =================================
  78.     // === Internal part, do not use ===
  79.     // =================================
  80.         
  81.         // • Member functions
  82.         // ------------------
  83.         
  84.     private:
  85.     
  86.         void                DrawAssociateMenuBar();
  87.         
  88.         virtual void        ActivateSelf();
  89.         
  90.         void                FreeMenuBar();
  91.         
  92.         virtual Boolean        ObeyCommand(    CommandT    inCommand,
  93.                                             void*        ioParam        );    
  94.                                             
  95.         virtual void        FindCommandStatus(    CommandT    inCommand,
  96.                                                 Boolean        &outEnabled,
  97.                                                 Boolean        &outUsesMark,
  98.                                                 Char16        &outMark,
  99.                                                 Str255        outName            );
  100.                                                 
  101.         virtual void        ListenToMessage(MessageT inMessage, void *ioParam);
  102.                     
  103.                     
  104.         // • Member variables
  105.         // ------------------
  106.         
  107.     private:
  108.     
  109.         SCAPIMenuBar*        mMenuBarP;
  110.         SCAPIApp*            mAppP;
  111.         
  112.         
  113.         // • Static variables
  114.         // ------------------
  115.         
  116.     private:
  117.     
  118.         static int            sNumWindows;
  119. };
  120.  
  121. #endif